<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'campaign.label', default: 'Campaign')}"/>
    <title>市场活动详情</title>
</head>

<body>
<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>市场活动详情</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="campaign" action="index">市场活动列表</g:link>
                    </li>
                    <li class="breadcrumb-item">市场活动详情</li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span></button>
                </div>
            </g:if>

        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>市场活动详情</h5>

                    <div class="card-header-right">
                      <g:if test="${this.follow}">
                        <g:link  controller="follow" action="cancelFollow" id="${this.follow?.id}" data-toggle="tooltip" data-placement="top" title="" data-original-title="取消关注">
                            <i class="fa fa-heart"></i>
                        </g:link>
                      </g:if>
                      <g:else>
                        <g:link  controller="follow" action="addFollow" params="[followObject: 'campaign', objectId: this.campaign?.id]" data-toggle="tooltip" data-placement="top" title="" data-original-title="关注">
                            <i class="fa fa-heart-o"></i>
                        </g:link>
                      </g:else>
                        <g:link action="edit" resource="${this.campaign}" data-toggle="tooltip" data-placement="top"
                                title="" data-original-title="编辑">
                            <i class="icofont icofont-edit"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">名称</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.name}</span>
                        </div>
                        <label class="col-md-2 col-form-label">用户</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.user?.fullName}</span>
                        </div>

                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">是否启用</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.active}</span>
                        </div>
                        <label class="col-md-2 col-form-label">状态</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.status?.name}</span>
                        </div>
                    </div>


                    <div class="form-group row">

                        <label class="col-md-2 col-form-label">区域</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.territory?.name}</span>
                        </div>
                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">市场活动父级</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.parent?.name}</span>
                        </div>
                        <label class="col-md-2 col-form-label">类型</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.type?.name}</span>
                        </div>
                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">开始时间</label>

                        <div class="col-md-3">
                            <span class="cont">
                                <g:formatDate date="${this.campaign?.startTime}"
                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                            </span>
                        </div>
                        <label class="col-md-2 col-form-label">结束时间</label>

                        <div class="col-md-3">
                            <span class="cont">
                                <g:formatDate date="${this.campaign?.endTime}"
                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                            </span>
                        </div>
                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">创建人</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.createBy}</span>
                        </div>
                        <label class="col-md-2 col-form-label">修改人</label>

                        <div class="col-md-3">
                            <span class="cont">${this.campaign?.createBy}</span>
                        </div>
                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">活动描述</label>

                        <div class="col-md-8">
                            <span class="cont">${this.campaign?.description}</span>
                        </div>
                    </div>

                </div>

            </div>

            <div class="card">
                <div class="card-header">
                    <h5>定制字段</h5>

                    <div class="card-header-right">
                      <!-- <g:link controller="flexFieldInstance" action="create" params="[campaign: this.campaign?.id]"
                               data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                           <i class="icofont icofont-plus"></i>
                       </g:link> -->
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <g:render template="/layouts/mashTemplate/flexFieldInstanceTemplate"/>
            </div>

            <div class="card">
                <div class="card-header">
                    <h5>笔记</h5>

                    <div class="card-header-right">
                        <g:link controller="note" action="create" params="[campaign: this.campaign?.id]"
                                data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                            <i class="icofont icofont-plus"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <g:render template="/layouts/mashTemplate/noteTemplate"/>
            </div>

            <div class="card">
                <div class="card-header">
                    <h5>拜访</h5>

                    <div class="card-header-right">
                        <g:link controller="activity" action="createAppointment" params="[campaign: this.campaign?.id]"
                                data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                            <i class="icofont icofont-plus"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <g:render template="/layouts/mashTemplate/appointmentTemplate"/>
            </div>

            <div class="card">
                <div class="card-header">
                    <h5>任务</h5>

                    <div class="card-header-right">
                        <g:link controller="activity" action="createTask" params="[campaign: this.campaign?.id]"
                                data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                            <i class="icofont icofont-plus"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <g:render template="/layouts/mashTemplate/taskTemplate"/>
            </div>

            <div class="card">
                <div class="card-header">
                    <h5>团队</h5>

                    <div class="card-header-right">
                        <g:link controller="campaignTeam" action="create" params="[campaign: this.campaign?.id]"
                                data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                            <i class="icofont icofont-plus"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <g:render template="/layouts/mashTemplate/teamTemplate"/>
            </div>

            <div class="card">
                <div class="card-header">
                    <h5>附件</h5>

                    <div class="card-header-right">
                        <g:link controller="attachment" action="create" params="[campaign: this.campaign?.id]"
                                data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                            <i class="icofont icofont-plus"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <g:render template="/layouts/mashTemplate/attachmentTemplate"/>
            </div>

        </div>

        <!-- Page-body end -->
    </div>
</div>


</body>
</html>
